﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Mindfor.Web.Models
{
	/// <summary>
	/// Contains widget place and action path.
	/// </summary>
	public class WidgetModel
	{
		/// <summary>
		/// Gets or sets widget action path.
		/// </summary>
		public ActionPath ActionPath { get; set; }

		/// <summary>
		/// Gets or sets widget parameter.
		/// </summary>
		public string WidgetParam { get; set; }

		/// <summary>
		/// Gets or sets widget place.
		/// </summary>
		public string Place { get; set; }

		/// <summary>
		/// Initialzies new instance.
		/// </summary>
		/// <param name="place">Widget place.</param>
		/// <param name="moduleName">Action module name.</param>
		/// <param name="controllerName">Action controller name.</param>
		/// <param name="actionName">Action name.</param>
		/// <param name="widgetParam">Parameter to pass to widget.</param>
		public WidgetModel(string place, string moduleName, string controllerName, string actionName, string widgetParam)
		{
			Place = place;
			ActionPath = new ActionPath(moduleName, controllerName, actionName);
			WidgetParam = widgetParam;
		}

		/// <summary>
		/// Initialzies new instance.
		/// </summary>
		/// <param name="place">Widget place.</param>
		/// <param name="actionPath">Widget action path.</param>
		/// <param name="widgetParam">Parameter to pass to widget.</param>
		public WidgetModel(string place, ActionPath actionPath, string widgetParam)
		{
			Place = place;
			ActionPath = actionPath;
			WidgetParam = widgetParam;
		}
	}
}
